package custom;

public class Words {
    public static int[] lengthOfStringArray(char[][] words) {
        int[] lengths = new int[words.length];
        for (int i = 0; i < lengths.length; i++)
            lengths[i] = words[i].length;
        return lengths;
    }

    public static void printOfTransposition(char[][] words) {
        int[] counts = lengthOfStringArray(words);
        int indexOfMax = CustomArray.findIndexOfMax(counts);
        for (int j = 0; j < counts[indexOfMax]; j++) {
            for (int i = words.length - 1; i >= 0; i--)
                if (j < counts[i])
                    System.out.printf(words[i][j] + "\t");
                else
                    System.out.print(" \t");
            System.out.println();
        }
    }
}
